﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//import
using ddcCajamarca.BusinessEntities.Documentos;
using System.Data.Entity.ModelConfiguration;
using System.ComponentModel.DataAnnotations.Schema;

namespace ddcCajamarca.Repository.Mapping.Documentos
{
    public class AreaMap : EntityTypeConfiguration<Area>
    {
        public AreaMap()
        {

            this.HasKey(c => c.Id);

            this.Property(c => c.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(c => c.NombreArea)
                .HasMaxLength(30)
                .IsRequired();

            this.Property(c => c.DescripcionArea)
                .HasMaxLength(120)
                .IsOptional();

            this.ToTable("Area");
            this.Property(c => c.Id).HasColumnName("Id");
            this.Property(c => c.NombreArea).HasColumnName("NombreArea");
            this.Property(c => c.DescripcionArea).HasColumnName("DescripcionArea");
        }

    }
}
